<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Cart extends Model
{
    protected $fillable = ['goods_id', 'spec_goods_price_id', 'user_id', 'quantity'];

    protected $casts = [
        'checked' => 'boolean'
    ];
    public function goods()
    {
        return $this->belongsTo('App\Goods');
    }

    public function spec()
    {
        return $this->belongsTo('App\SpecGoodsPrice', 'spec_goods_price_id');
    }
}
